const sqlMap = {
    user: {
        // 用户验证（事务）
        confirm: 'select * from tab_stu where (account = ? and password = ?) or (email = ? and password = ?)',
        cntUp: 'update tab_stu set cnt = ? + 1 where account = ?',
        // 用户注册
        register: 'insert ignore into tab_stu(name, account, email, password, power, regTime) values(?,?,?,123456,0,CURRENT_TIMESTAMP)',
        // 重置密码
        resetPassword: 'update tab_stu set account = ?, password = ? where email = ?',
        // 忘记密码
        backPassword: 'update tab_stu set password = ? where email = ?',
        // 获取个人信息
        getProfile: 'select * from tab_stu where id = ?',
        // 修改个人信息
        setProfile: 'update tab_stu set name = ?, gender = ?,  class = ? where id = ?',
        // 查询学分申请记录
        getApply: 'select * from tab_creApplyInfo where sid = ?',
        // 小滚动栏
        getApplyList: 'select judge_Time,reason,after_changeCre from tab_creApplyInfo where sid = ?',
        //查询已通过的学分
        getCreditRecord: 'select * from tab_creApplyInfo where sid = ? and state = 1',
        // 查询反馈记录
        getFeedBack: 'select * from tab_feedback where sid = ?',
        // 查询学分申请列表
        getCreditApplyList: 'SELECT * FROM tab_creApplyInfo where sid = ?',
        // 申请学分
        applyCredit: 'insert ignore into tab_creApplyInfo (sid, apply_Time, pic_path, reason, creditNumber) values(?, now(), ?, ?, ?)',
        // 反馈
        feedback: 'insert ignore into tab_feedback (sid, feedback_Time, pic_path, content) values(?, CURRENT_TIMESTAMP, ?, ?)',
    },
    admin: {
        // 用户验证
        confirm: 'select * from tab_admin where account = ? and password = ?',
        // 获取所有班级
        getLocalAllClass: 'select mng_class as class from tab_mana',
        // 获取班级所有学分申请
        getClassApply: 'select * from tab_stu inner join tab_creApplyInfo where id = sid and class = ?',
        // 获取班级所有反馈记录
        getClassFeedback: 'select * from tab_stu inner join tab_feedback where id = sid and class = ?',
        //添加团支书
        AddPartySecretary: 'insert ignore into tab_mana(name, mng_class, account,info, password,power) values(?,?,?,?,123,1)',
        // 删除团支书的所有信息
        DeleteThePartySecretary: 'delete from tab_mana where mid = ?',
        // 修改团支书信息
        ModifyThePartySecretary: 'update tab_mana set name = ?, mng_class = ?, account = ?, info = ? where mid = ?',
        //添加学生
        studentadd: 'insert ignore into tab_stu(name, gender, class, account,credit,SuperAdmin, password,power,regTime) values(?,?,?,?,?,?,123456,0,CURRENT_TIMESTAMP)',
        // 查找全部学生用户
        getAllUserStudent: 'select  id, name, gender, class, account, credit, SuperAdmin from tab_stu order by id ASC',
        // 查找学生信息
        getStudentInfo: 'select id, name, gender, class ,account, credit, SuperAdmin from tab_stu where id = ?',
        // 查找全部学生信息
        getAllStudentInfo: 'select * from student',
        // 更新学生信息
        setStudentProfile: 'update tab_stu set name = ?, gender = ?, class = ?, account = ?, credit = ?, SuperAdmin = ? where id = ?',
        // 删除学生的所有信息
        deleteStudentInfo: 'delete from tab_stu where id = ?',
        // 获取所属团支书信息
        getLocalPartySecretary: 'select * from tab_mana order by mid ASC'
    },
    management: {
        // 用户验证
        confirm: 'select * from tab_mana where account = ? and password = ?',
        // 获取团支书个人信息
        getLocalProfile: 'select * from tab_mana where mid = ?',
        // 修改个人信息
        editLocalProfile: 'update tab_mana set name = ?, info = ? where mid = ?',
        // 查询当前班级学生学分申请
        getAllApply: 'select * from tab_stu inner join tab_creApplyInfo where id = sid and class in (SELECT mng_class FROM tab_mana where mid = ?)',
        // 查询当前班级学生反馈
        getAllFeedBack: 'select * from tab_stu inner join tab_feedback where id = sid and class in (SELECT mng_class FROM tab_mana where mid = ?)',
        // 回复反馈
        ReplyToStudentFeedback: 'update tab_feedback set reply = ?, state = 1, fJudge_Time = now() where fid = ?',
        // 查询本班学生列表
        getLocalStudents: 'select * from tab_stu where class in (SELECT mng_class FROM tab_mana where mid = ?)',
        // 获取已同意的学生学分申请
        getLocalStudentAgreeAllApply: 'select * from tab_creApplyInfo where sid = ? and state = 1',
        // 同意此学分申请（事务）
        AgreeToStudentRequest: 'update tab_creApplyInfo set state = 1, judge_Time = now(), after_changeCre = ? where cid = ?',
        creditUp: 'update tab_stu set credit = ? where id = ?'  ,
        // 拒绝此学分申请
        DenyToStudentRequest: 'update tab_creApplyInfo set state = 2, judge_Time = now() where cid = ?',
        creditDown: 'update tab_stu set credit = ? where id = ?',
        // 忽略反馈
        IgnoreStudentFeedback: 'update tab_feedback set state = 2 where fid = ?'
    }
};
module.exports = sqlMap
